<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
    <style>
        /* 通用样式 */
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f7fc;
            color: #333;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        /* 注册框样式 */
        .register-container {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            padding: 40px;
            width: 300px;
            text-align: center;
        }

        .register-container h1 {
            font-size: 24px;
            margin-bottom: 20px;
            color: #2c3e50;
        }

        .register-container label {
            display: block;
            text-align: left;
            margin: 10px 0 5px;
            font-weight: bold;
            color: #2c3e50;
        }

        .register-container input {
            width: 100%;
            padding: 10px;
            margin-bottom: 20px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 16px;
        }

        .register-container input[type="submit"] {
            background-color: #3498db;
            color: white;
            border: none;
            cursor: pointer;
            font-size: 18px;
            transition: background-color 0.3s;
        }

        .register-container input[type="submit"]:hover {
            background-color: #2980b9;
        }

        .register-container p {
            font-size: 14px;
            color: #7f8c8d;
        }

        .register-container a {
            color: #3498db;
            text-decoration: none;
            font-weight: bold;
        }

        .register-container a:hover {
            text-decoration: underline;
        }

        /* 错误提示 */
        .error {
            color: red;
            font-size: 14px;
            margin-bottom: 20px;
        }
    </style>
</head>
<body>

<div class="register-container">
    <h1>用户注册</h1>

    <form action="register" method="post">
        <label for="username">用户名:</label>
        <input type="text" id="username" name="username" required />

        <label for="password">密码:</label>
        <input type="password" id="password" name="password" required />

        <input type="submit" value="注册" />
    </form>

    <c:if test="${not empty error}">
        <p class="error">${error}</p>
    </c:if>

    <p>已有账号？<a href="login.jsp">去登录</a></p>
</div>

</body>
</html>
